<template>
    <rx-dialog :showok="false" :showcancel="false" >
        <rx-layout>
            <div slot="center">
                <a-form-model ref="form" :model="mdl" :rules="rules" :label-col="labelCol" :wrapper-col="wrapperCol">
                    <a-form-model-item :label="i18n('form.boName','实体名称')" prop="boName">
                        {{mdl.boName}}
                    </a-form-model-item>
                    <a-form-model-item :label="i18n('form.boAlias','实体别名')" prop="boAlias">
                        {{mdl.boAlias}}
                    </a-form-model-item>
                    <a-form-model-item :label="i18n('form.type','类型')" prop="type">
                        <a-tag :color="typeMap[mdl.type].color">
                            <span>{{ typeMap[mdl.type].text }}</span>
                        </a-tag>
                    </a-form-model-item>
                    <a-form-model-item :label="i18n('form.sn','序号')" prop="sn">
                        {{mdl.sn}}
                    </a-form-model-item>
                    <a-form-model-item :label="i18n('form.sql','SQL语句')" prop="sql">
                        <a-textarea :readonly="true" :auto-size="{ minRows: 10}" v-model="mdl.sql"/>
                    </a-form-model-item>
                </a-form-model>
            </div>
        </rx-layout>
    </rx-dialog>
</template>
<script>
import FormChangeLogApi from '@/api/form/core/formChangeLog'
import {RxDialog, BaseFormModel} from "@lowcode/jpaas-common-lib";


export default {
    name: 'FormChangeLogEdit',
    mixins: [BaseFormModel],
    components: {
        RxDialog,
    },
    data() {
        return {
            /**
             * 子表列表，以及表格属性
             */
            subTable: {},
            rules: {
                boAlias: [{required: false, message: this.i18n('form.boAlias','请输入BO别名','input'), trigger: 'change'}],
                boName: [{required: false, message: this.i18n('form.boName','请输入BO名称','input'), trigger: 'change'}],
                type: [{required: false, message: this.i18n('form.type','请输入类型','input'), trigger: 'change'}],
                sn: [{required: false, message: this.i18n('form.sn','请输入序号','input'), trigger: 'change'}],
                sql: [{required: false, message: this.i18n('form.sql','请输入SQL语句','input'), trigger: 'change'}],
            },
            typeMap: {
                'add': {color: 'green', text: this.$ti18('rxList.add','新增')},
                'upd': {color: 'blue', text: this.$ti18('rxList.update','更新')},
                'del': {color: 'red', text: this.$ti18('rxList.delBtn','删除')}
            }
        }

    },
    methods: {
        i18n(name,text,key){
            return this.$ti18(name,text,"FormChangeLog",key);
        },
        get(id) {
            return FormChangeLogApi.get(id);
        },
        // save() {
        //     return FormChangeLogApi.save(this.mdl);
        // },

    }
}
</script>
<style>
.relick a {
    margin-right: 10px;
}

</style>
